package PolymorphicHomeworkTest3;

public class Person {
    private String name;
    private int age;
    private char sex;
    public Person(){

    }
    public Person(String name,int age,char sex){
        this.name = name;
        this.age = age;
        this.sex = sex;
    }
    public String getName(){
        return this.name;
    }
    public void setName(String name){
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                '}';
    }
    public void ill(){
        System.out.println(this.getName()+","+this.getSex()+","+this.getAge()+"生病了");
    }
}
